package com.example.a33mvvm.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.a33mvvm.R;
import com.example.base_mvvm.entity.MessageEntity;

import java.util.List;

public class MessageAdapter extends BaseQuickAdapter<MessageEntity, BaseViewHolder> {
    public MessageAdapter(@Nullable List<MessageEntity> data) {
        super(R.layout.item_message, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, MessageEntity messageEntity) {
        String msg = messageEntity.getName() + ":" + messageEntity.getMessage();
        baseViewHolder.setText(R.id.item_msg_tv,msg);
    }
}
